<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
	</head>

	<body>
		<script type="text/javascript">
			//						axios.post('http://demo.sqsh365.com:7001/ytyyjh/rest/medical/account/check', {
			//								idCard: '370631197902088041',
			//								type: 'doctor'
			//							})
			//							.then(function(response) {
			//								console.log(response);
			//							})
			//							.catch(function(error) {
			//								console.log(error);
			//							});
			//JSON.stringify()
			/*
						axios({
								method: 'post',
								url: 'http://demo.sqsh365.com:7001/ytyyjh/rest/medical/account/check',
								transformRequest: [function(data) {
									var formData = new FormData();
									formData.append('idCard', '370631197902088041');
									formData.append('type', 'doctor');
			//						data=['idCard': '370631197902088041',{'type': 'doctor'}]
									return formData;
								}],
								data: {
									idCard: '370631197902088041',
									type: 'doctor'
								}
							})
							.then(function(response) {
								console.log(response);
							})
							.catch(function(error) {
								console.log(error);
							});*/
							/*
			axios({
					method: 'post',
//					headers: {
//						'Content-type': 'application/x-www-form-urlencoded'
//					},
					url: 'http://demo.sqsh365.com:7001/ytyyjh/rest/medical/account/check',
					transformRequest: [function(data) {
						let ret = ''
						for(let it in data) {
							ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it])+ '&' 
						}
						return ret
					}],
					data: {idCard: '370631197902088041',type: 'doctor'}
				})
				.then(function(response) {
					console.log(response);
				})
				.catch(function(error) {
					console.log(error);
				});*/
				
				
				/*****
				 * FormData请求方式
				 * ******/
				/*
				axios({
					method: 'post',
					url: 'http://demo.sqsh365.com:7001/ytyyjh/rest/medical/account/check',
					data: "idCard=370631197902088041&type=doctor"
				})
				.then(function(response) {
					console.log(response);
				})
				.catch(function(error) {
					console.log(error);
				});*/
				/***
				 * 带头部headers的请求
				 * ****/
				axios({
					method: 'post',
					url: 'http://demo.sqsh365.com:7001/ytyyjh/rest/customerApp/pgApply/pgApplyList',
					headers: {"userId":"1c58ca4c-90b8-4c27-a3d1-cac5b6fd630b","token":"47b805a8-245a-49b3-9dfb-42ebbcb7c69d"},
					data: "pageNo=0&pageSize=10"
				})
				.then(function(response) {
					console.log(response);
				})
				.catch(function(error) {
					console.log(error);
				});
		</script>
	</body>

</html>